"use strict";(self.webpackChunkpeaches=self.webpackChunkpeaches||[]).push([[2401],{92401:function(n,e,t){t.r(e),t.d(e,{ReferralBanner:function(){return ReferralBanner}});var o=t(45400),a=t(77059),r=t(42305),i=t(542),c=t(93371),l=t(44570),u=t(36308),s=t(83292),p=t(74064),d=t(41621);function _templateObject(){let n=(0,s._)(["\n 0% {\n opacity: 0;\n transform: translateY(3px);\n }\n 50% {\n opacity: 0.50;\n transform: translateY(2px);\n }\n 75% {\n opacity: 0.75;\n transform: translateY(1px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0px);\n }\n"]);return _templateObject=function(){return n},n}function _templateObject1(){let n=(0,s._)(["\n display: block;\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n width: 100%;\n"]);return _templateObject1=function(){return n},n}function _templateObject2(){let n=(0,s._)(["\n 0% {\n background-position: -468px 0;\n }\n 100% {\n background-position: 468px 0;\n }\n"]);return _templateObject2=function(){return n},n}function _templateObject3(){let n=(0,s._)(["\n background-color: #eee;\n margin: 0 auto;\n"]);return _templateObject3=function(){return n},n}function _templateObject4(){let n=(0,s._)(["\n animation-duration: 1.25s;\n animation-fill-mode: forwards;\n animation-iteration-count: infinite;\n animation-name: ",";\n animation-timing-function: linear;\n background: linear-gradient(to right, #eeeeee 10%, #dddddd 18%, #eeeeee 33%);\n background-size: 800px 104px;\n height: 36px;\n position: relative;\n"]);return _templateObject4=function(){return n},n}function _templateObject5(){let n=(0,s._)(["\n background-color: ",";\n color: ",";\n display: flex;\n min-height: 36px;\n width: 100%;\n &:hover {\n text-decoration: none;\n }\n\n animation: "," 2s;\n overflow: hidden;\n"]);return _templateObject5=function(){return n},n}function _templateObject6(){let n=(0,s._)(["\n align-items: center;\n display: flex;\n height: auto;\n margin: auto;\n max-width: 90rem;\n padding: 8px 14px;\n width: 100%;\n p {\n font-weight: 400;\n margin: 0px;\n }\n"]);return _templateObject6=function(){return n},n}function _templateObject7(){let n=(0,s._)(["\n background-color: ",";\n clip-path: polygon(50% 100%, 0% 0%, 100% 0%);\n display: ",";\n height: 11px;\n right: 40px;\n position: absolute;\n transform: translateX(-50%);\n width: 17px;\n\n @media "," {\n left: 20%;\n }\n\n @media "," {\n left: 16%;\n top: 40px;\n }\n\n @media (min-width: 90rem) {\n left: 18%;\n }\n"]);return _templateObject7=function(){return n},n}let m=(0,p.keyframes)(_templateObject()),f=p.default.div.withConfig({componentId:"sc-3e374cf9-0"})(_templateObject1()),_=(0,p.keyframes)(_templateObject2()),h=p.default.div.withConfig({componentId:"sc-3e374cf9-1"})(_templateObject3()),b=p.default.div.withConfig({componentId:"sc-3e374cf9-2"})(_templateObject4(),_),g=p.default.a.withConfig({componentId:"sc-3e374cf9-3"})(_templateObject5(),n=>{let{theme:e,backgroundColor:t}=n;return t||e.colors.brand.secondary},n=>{let{theme:e,titleColor:t}=n;return t||e.colors.grayscale.gray1},n=>{let{showAnimation:e}=n;return e&&m}),j=p.default.div.withConfig({componentId:"sc-3e374cf9-4"})(_templateObject6()),x=p.default.div.withConfig({componentId:"sc-3e374cf9-5"})(_templateObject7(),n=>{let{theme:e,backgroundColor:t}=n;return t||e.colors.brand.secondary},n=>{let{isShowed:e}=n;return!e&&"none"},d.qs.lg,d.qs.xl);var O=t(1556);function ReferralBanner(n){let{referralBanners:e}=n,[t,s]=(0,a.useState)(O.b.WITHOUT_ADDRESS_SECTION),{state:p,isAuthenticated:d}=(0,a.useContext)(l.c),m=(0,i.useRouter)(),_=(0,r.useSearchParams)(),k=_.get("userbar"),w=(0,c.RR)("has_default_postal_code"),y=(0,c.Ri)("postal_code"),{loyalty:C,id:I}=p,{status:v}=C,R=!w&&!!y,S=m.pathname.startsWith("/welcome"),T=(0,a.useMemo)(()=>S?(0,u.oh)(e,t):(0,u.eB)(e,v,d),[t,v,d]);(0,a.useEffect)(()=>{S&&R&&s(O.b.WITH_ADDRESS_AND_WITHOUT_ORDERS_SECTION)},[R]);let D=["/","/store/[slug]","/welcome/[slug]","/home"].includes(m.pathname),E="/home"===m.pathname;if(!T||E&&!k||!D)return(0,o.jsx)(o.Fragment,{});let{redirect:A,redirect_enabled:B}=T;return void 0===d?(0,o.jsx)(f,{children:(0,o.jsx)(h,{children:(0,o.jsx)(b,{})})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g,{showAnimation:E,onClick:()=>{(0,u.dn)(I,t,!S,T,C)},href:B&&A,backgroundColor:T.background_color,titleColor:T.title_color,children:(0,o.jsx)(j,{dangerouslySetInnerHTML:{__html:T.title_content}})}),(0,o.jsx)(x,{backgroundColor:T.background_color,isShowed:T.signaling_direction_enabled})]})}}}]);